//基础
var apiUrlUserGetAccount = '/api/User/getAccount';//账户信息
var apiUrlPassPostPortQuit = '/api/PassPort/Quit';//账户退出
var apiUrlUserPostPassword = '/api/User/postPassword';//修改账户密码
var apiUrlUserGetProjectList = '/api/User/getProjectList';//账户项目管理列表
var apiUrlProjectDeletProject = '/api/Project/deletProject';//项目删除
var apiUrlProjectPostProject = '/api/Project/postProject';//添加项目
var apiUrlProjectPutProject = '/api/project/putProject';//编辑项目

var apiUrlStoreGetProjectList = '/api/Project/getProjectList';//商店项目列表
var apiUrlGetProject = '/api/Project/getProject';//项目详情
var apiUrlGetProjectArea = '/api/Project/getProjectArea';//项目分区

/**
 * 页面滚动
 */
smoothScroll.init({
    speed: 300
});

/**
 * 主题响应
 */
$(function () {
    //CK设置默认主题
    if ($.cookie('them-layout') == null) {
        $.cookie('them-layout', 'light', { expires: 365 * 24 * 3600 * 1000, path: '/' });
    }

    //主题初始化
    if ($.cookie('them-layout') == 'dark') {
        $('body').attr('class', 'mdui-drawer-body-left mdui-appbar-with-toolbar mdui-theme-primary-' + DEFAULT_PRIMARY + ' mdui-theme-accent-' + DEFAULT_ACCENT + ' mdui-theme-layout-dark  mdui-loaded');
        $('#footerTheme').attr('class', 'mdui-color-grey-900');
        $('#iconTheme').text('brightness_3');
    } else {
        $('body').attr('class', 'mdui-drawer-body-left mdui-appbar-with-toolbar mdui-theme-primary-' + DEFAULT_PRIMARY + ' mdui-theme-accent-' + DEFAULT_ACCENT + ' mdui-theme-layout-light  mdui-loaded');
        $('#footerTheme').attr('class', 'mdui-color-theme');
        $('#iconTheme').text('brightness_5');
    }


    //按钮反转样式
    $('#iconTheme').click(function () {
        if ($('#iconTheme').text() == 'brightness_5') {
            //夜间
            $('#iconTheme').text('brightness_3');
            $.cookie('them-layout', 'dark', { expires: 365 * 24 * 3600 * 1000, path: '/' });
            $('body').attr('class', 'mdui-drawer-body-left mdui-appbar-with-toolbar mdui-theme-primary-' + DEFAULT_PRIMARY + ' mdui-theme-accent-' + DEFAULT_ACCENT + ' mdui-theme-layout-dark  mdui-loaded');
            $('#footerTheme').attr('class', 'mdui-color-grey-900');
        } else {
            //日间
            $('#iconTheme').text('brightness_5');
            $.cookie('them-layout', 'light', { expires: 365 * 24 * 3600 * 1000, path: '/' });
            $('body').attr('class', 'mdui-drawer-body-left mdui-appbar-with-toolbar mdui-theme-primary-' + DEFAULT_PRIMARY + ' mdui-theme-accent-' + DEFAULT_ACCENT + ' mdui-theme-layout-light  mdui-loaded');
            $('#footerTheme').attr('class', 'mdui-color-theme');
        }
    })

    //选择开关样式
    $('.js-switch').click(function () {
        if($(this).val() == 'false'){
            $(this).val('true');
        }else{
            $(this).val('false');
        }
    })

});